package com.neu.util;

import java.util.List;
import java.util.Map;

public class PrintMessage {

    //打印增删改结果
    public static void printNum(int num){
        if( num > 0 ){
            System.out.println("操作成功");
        }else {
            System.out.println("操作失败");
        }
    }

    /**
     * 打印账本信息集合
     * @param list
     */
    public static void printTradeList(List<Map<String,Object>> list){
        System.out.println(" 交易类型:(1存 2取 3代收代扣 4代发工资 5手续费)");
        System.out.println("交易记录编号\t交易类型\t交易日期\t交易金额\t所属用户编号\t");
        for(Map<String,Object> map : list){
            System.out.print(map.get("trade_no")+"\t");
            System.out.print(map.get("trade_code")+"\t");
            System.out.print(map.get("trade_date")+"\t");
            System.out.print(map.get("amount")+"\t");
            System.out.print(map.get("trade_client_no")+"\t");
        }
        System.out.println();
    }

    /**
     * 打印用户信息
     * @param map
     */
    public static void printClientMap(Map<String, Object> map){
        System.out.println("用户编号\t用户姓名\t用户性别:0女,1男\t出生日期\t");
        System.out.print(map.get("client_no")+"\t");
        System.out.print(map.get("client_name")+"\t");
        System.out.print(map.get("sex")+"\t");
        System.out.print(map.get("birthday")+"\t");
        System.out.println();
    }
}
